<admintpl file="header" />
</head>
<body>
<div class="wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a>跑客提款记录</a></li>
    </ul>
    <form class="well form-search" method="post" action="{:U('Finance/pncash_list')}">
        跑客姓名：<input type="text" name="formget[dispatch_name]" style="width: 100px;" value="{$formget.dispatch_name}">
        跑客电话：<input type="text" name="formget[mobile]" style="width: 100px;" value="{$formget.mobile}">
        所属团队：
        <select class="select_2" name="formget[company_id]"  style="width: 90px;" >
            <option value='1'{$formget[company_id]==1?selected:''}>全部跑客</option>
            <option value='2'{$formget[company_id]==2?selected:''}>大河跑客</option>
            <option value='3'{$formget[company_id]==3?selected:''}>直属跑客</option>
            <option value='4'{$formget[company_id]==4?selected:''}>社会跑客</option>
            <option value='5'{$formget[company_id]==5?selected:''}>校园跑客</option>
        </select> &nbsp;&nbsp;
        提款时间：
        <input type="text" name="formget[start_time]" class="js-date" value="{$formget.start_time|default=''}" style="width: 90px;" autocomplete="off">-
        <input type="text" class="js-date" name="formget[end_time]" value="{$formget.end_time}" style="width: 90px;" autocomplete="off"> &nbsp; &nbsp;
        &nbsp;&nbsp;
        状态：
        <select class="select_2" name="formget[status]"  style="width: 80px;" >
            <option value='-1'{$formget[status]==-1?selected:''}>全部</option>
            <option value='0'{$formget[status]==0?selected:''}>未处理</option>
            <option value='1'{$formget[status]==1?selected:''}>已审核</option>
            <option value='2'{$formget[status]==2?selected:''}>已汇款</option>
        </select> &nbsp;&nbsp;
        <input type="submit" class="btn btn-primary" value="搜索" />
    </form>
    <form method="post" class="js-ajax-form">
        <div class="table-actions">
            <button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('Finance/pncash_audit',array('audit'=>1,'formget'=>$formget))}" data-subcheck="true" data-msg="您确定审核吗？">审核</button>
            <button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('Finance/pncash_pay',array('pay'=>1,'formget'=>$formget))}" data-subcheck="true" data-msg="您确定已经打款了吗？">打款</button>
            <button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('Finance/pncash_cancelaudit',array('audit'=>1,'formget'=>$formget))}" data-subcheck="true" data-msg="您确定取消审核吗？">取消审核</button>
        </div>
       <table class="table table-hover table-bordered">
            <thead>
            <tr>
                <th width="15"><label><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x"></label></th>
                <th align="center">序号</th>
                <th>跑客姓名</th>
                <th>身份证号</th>
                <th>ID</th>
                <th>openID</th>
                <th>跑客电话</th>
                <th>所属团队</th>
                <th>提款金额</th>
                <th>提款时间</th>
                <th>状态</th>
                <th>打款时间</th>
                <th>说明</th>
            </tr>
            </thead>
            <tbody>
            <php>
                $statuss=array("0"=>'未处理',"1"=>'已审核',"2"=>'已汇款');
                $statusc=array("2"=>"大河跑客","3"=>"直属跑客","4"=>"社会跑客","5"=>"校园跑客");
            </php>  
            <foreach name="datas" item="vo" key="k">
                <tr>
                    <td><input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]" value="{$vo.cash_record_id}" title="ID:{$vo.cash_record_id}"></td>
                    <td align="center">{$k+1}</td>
                    <td>
                        <a href="#" onclick="balance_list({$vo['dispatch_id']},'{$vo.dispatch_id|getDispatchName}','{$vo[cash_balance]}','{$formget[start_time]}','{$formget[end_time]}')" >{$vo.dispatch_id|getDispatchName}</a>
                    </td>
                    <td>{$vo.cert_number}</td>
                    <td>wx9e81b4c3c459a480</td>
                    <td>{$vo.weinxin_openid}</td>
                    <td>{$vo.dispatch_id|getDispatchMobile}</td>
                    <td>{$vo[company_name]}</td>
                    <td>{$vo[cash_amount]}</td>
                    <td>{$vo.cash_time}</td>
                    <td>{$statuss[$vo[status]]}</td>
                    <td>{$vo.pay_time}</td>
                    <td>{$vo.remark}</td>
                </tr>
            </foreach>
            </tbody>
        </table>
        <if condition="empty($datas)">
            <div style="padding: 30px;text-align: center;color: #999999">
                <i class="fa fa-database" style="font-size: 38px"></i><br />
                暂无数据
            </div>
        </if>
        <div class="pagination">{$page}</div>
    </form>
</div>
<script src="__PUBLIC__/js/common.js"></script>
<script>
function balance_list(dispatch_id,dispatch_name,cash_balance,start_time,end_time){
//iframe层
    layer.open({
        type: 2,
        title: dispatch_name+'钱包明细（账户余额￥'+cash_balance+'元）',
        shadeClose: true,
        shade: 0.4,
        area: ['30%', '60%'],
        content: '{:U("Finance/balance_list")}&dispatch_id='+dispatch_id+'&start_time='+start_time+'&end_time='+end_time //iframe的url
    });
    }
</script>
</body>
</html>